package tankwar;

import java.awt.Graphics;//awt抽象窗口工具集
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.Toolkit;

public abstract class GameObject {
	//图片
	public Image img;
	//坐标
	public int x;
	public int y;
	//界面
	private Panel gamePanel;
	
	public GameObject(String img,int x,int y,Panel gamePanel) {
		this.img=Toolkit.getDefaultToolkit().getImage(img);//this指向实例化的自己，获取图片
		this.x=x;
		this.y=y;
		this.gamePanel=gamePanel;
	}
	
	public abstract void paintSelft(Graphics g);
	
	public abstract Rectangle gerRec();//返回自身矩形
}
